package csi.pitstop.core;

import java.io.File;
import java.io.IOException;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

public class TestMain {

	public static void main(String[] args) throws Exception {
		//get the factory
//		DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

//		try {

			//Using factory get an instance of document builder
//			DocumentBuilder db = dbf.newDocumentBuilder();
//
//			//parse using builder to get DOM representation of the XML file
//			Document doc = db.parse("/Users/macbookpro/Teste_PitStop/output/Pilha Documentos_log.xml");
//
//			doc.getDocumentElement().normalize();
//			System.out.println("Root element " + doc.getDocumentElement().getNodeName());
//			NodeList nodeLst = doc.getElementsByTagName("employee");
//			System.out.println("Information of all employees");


			JAXBContext jaxbContext = JAXBContext.newInstance(EnfocusReport.class);
			Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
			EnfocusReport customer = (EnfocusReport) jaxbUnmarshaller.unmarshal(new File("/Users/macbookpro/Teste_PitStop/output/teste.xml"));
			System.out.println(customer);
			
//		}catch(ParserConfigurationException pce) {
//			pce.printStackTrace();
//		}catch(SAXException se) {
//			se.printStackTrace();
//		}catch(IOException ioe) {
//			ioe.printStackTrace();
//		}
	}

}
